;(function  ($) {
	var myClazz = function  () {
		var frmReg;
		var btnReg;
		var loadEvent = function  () {
			btnReg.bind("click",subRegCustom);
		}
		
		var subRegCustom = function  () {
			var formData = new FormData(frmReg[0]);
			$.ajax({
				type:"post",
				url:"save.do",
				dataType:"JSON",
				data:formData,
				processData:false,
				contentType:false,
				success:function  (objUser) {
					alert("恭喜,"+objUser.username+"用户注册成功!");
					$("#regModal").modal('hide');
				}
			});
		}
		
		return {
			init:function  () {
				frmReg = $("#frmReg");
				btnReg = $("#btnSub");
				loadEvent();
			}
		}
	}();
	myClazz.init();
})(jQuery);